PDF Xpress for ActiveX - User Guide > How To > Work with Attachments and Portfolio Documents |
PDF Xpress™ supports working with Attachments and Portfolio Documents.
To determine if a PDF document is a Portfolio, check the IsPortfolio property.
If the document is a Portfolio, if rasterized then what’s rendered is the Portfolio’s Cover Sheet. To access the contents of the portfolio you need to get the Document’s attachments.
The following is an example in which a PDF document is opened, a determination is made as to whether it's a portfolio, and the attachments of the document are accessed. You can then build a UI to show the various properties of the attachments, open the attachment’s data, and modify it.
VB 6 |
Copy Code
|
---|---|
Option Explicit Dim pdf As PdfXpress Private Sub Command1_Click() pdf.Initialize Dim doc As New PdfDocument doc.SetParentControl pdf doc.OpenDocument "portfolio.pdf", "" If (doc.IsPortfolio = True) Then Dim attachmentCount As Long attachmentCount = doc.GetAttachmentCount Dim attachmentIndex As Integer For attachmentIndex = 0 To attachmentCount - 1 Dim attachment As New PdfDocumentAttachment Set attachment = doc.GetAttachment(attachmentIndex) 'access the attachment data as you please here... Next attachmentIndex End If End Sub |